package com.example.damaimaven.util;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;

import java.nio.file.Paths;

public class MyBatisPlusGenerator {

    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/damai", "root", "2389792129zZ")
                .globalConfig(builder -> builder
                        .author("zzh")
                        .outputDir("D:/新建文件夹")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.example.damaimaven")
                        .entity("entity")//实体类包名
                        .mapper("mapper")//数据库访问接口包名
                        .service("service")//业务层包名(接口)
                        .serviceImpl("service.impl")//业务层实现类包名
                        .xml("mapper.xml") //MyBatis sql映射文件包名
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
                .execute();
    }
}
